﻿using Hangfire;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace BestTrader.Cms.Hangfire
{
    public class CheckService : ICheckService
    {
        private readonly ILogger<CheckService> _logger;
        private ITimerService _timeservice;
        public CheckService(ILoggerFactory loggerFactory,
            ITimerService timerService)
        {
            _logger = loggerFactory.CreateLogger<CheckService>();
            _timeservice = timerService;
        }
        public void Check()
        {
            BackgroundJob.Schedule(() => _timeservice.Timer(), TimeSpan.FromMilliseconds(30));
        }
    }
}
